<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>连续签到配置</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<shiro:hasPermission name="sys:user:edit"><li class="active"><a href="${ctx}/wechat/signupConfig/">连续签到列表</a></li></shiro:hasPermission>
		<li ><a href="${ctx}/wechat/signupConfig/form?id=${signupConfig.id}">连续签到配置<shiro:hasPermission name="wechat:signupConfig:edit">${not empty signupConfig.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:signupConfig:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="signupConfig" action="${ctx}/wechat/signupConfig/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="user.name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<th>所属商家</th>
		<th>设置周期的天数</th>
		<th>分值（元）</th>
		<th>用户获得的最大分值（元）</th>
		<th>是否开启</th>
		<th>备注</th><shiro:hasPermission name="wechat:signupConfig:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="signupConfig">
			<tr>
				<td><a href="${ctx}/wechat/signupConfig/form?id=${signupConfig.id}">${signupConfig.user.name }</a></td>
				<td>${signupConfig.dayNumber}</td>
				<td>
					<c:if test="${signupConfig.score eq null}">0</c:if>
		          	<c:if test="${signupConfig.score ne null}">
		          		<c:if test="${signupConfig.score eq 0}">0</c:if>
		          		<c:if test="${signupConfig.score ne 0}">
				       		<fmt:formatNumber value="${signupConfig.score/1000}" pattern="#,###.###"  minFractionDigits="3"/>
		          		</c:if>
		          	</c:if>
					<%-- ${signupConfig.score} --%>
				</td>
				<td>
					<c:if test="${signupConfig.maxScore eq null}">0</c:if>
		          	<c:if test="${signupConfig.maxScore ne null}">
		          		<c:if test="${signupConfig.maxScore eq 0}">0</c:if>
		          		<c:if test="${signupConfig.maxScore ne 0}">
				       		<fmt:formatNumber value="${signupConfig.maxScore/1000}" pattern="#,###.###"  minFractionDigits="3"/>
		          		</c:if>
		          	</c:if>
					<%-- ${signupConfig.maxScore} --%>
				</td>
				<td>${signupConfig.startup?'开启':'关闭'}</td>
				<td>${signupConfig.remarks}</td>
				<shiro:hasPermission name="wechat:signupConfig:edit"><td>
    				<a href="${ctx}/wechat/signupConfig/form?id=${signupConfig.id}">修改</a>
					<shiro:hasPermission name="sys:user:edit"><a href="${ctx}/wechat/signupConfig/delete?id=${signupConfig.id}" onclick="return confirmx('确认要删除该抽奖配置吗？', this.href)">删除</a></shiro:hasPermission>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
